package com.boruan.qq.zxgylibrary.ui.activities;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import com.boruan.qq.zxgylibrary.R;
import com.boruan.qq.zxgylibrary.base.BaseActivity;

import butterknife.BindView;
import butterknife.OnClick;
import com.boruan.qq.zxgylibrary.R2;

/**
 * Created by 崔琦 on 2019/8/28.
 * des: 新增发票
 */

public class NewAddInvoiceActivity extends BaseActivity implements RadioGroup.OnCheckedChangeListener{
    @BindView(R2.id.rb_unit)
    RadioButton rbUnit;
    @BindView(R2.id.rb_personal)
    RadioButton rbPersonal;
    @BindView(R2.id.rg_unit_personal)
    RadioGroup rgUnitPersonal;
    @BindView(R2.id.edt_input_rise_name)
    EditText edtInputRiseName;
    @BindView(R2.id.edt_input_ein)
    EditText edtInputEin;
    @BindView(R2.id.ll_ein)
    LinearLayout llEin;

    @Override
    protected int getLayoutId() {
        if (Build.VERSION.SDK_INT >= 21) {
            View decorView = getWindow().getDecorView();
            decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
        return R.layout.drug_activity_add_invoice;
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        rgUnitPersonal.setOnCheckedChangeListener(this);
    }

    @OnClick({R2.id.iv_back, R2.id.btn_save})
    public void onViewClicked(View view) {
        int i = view.getId();
        if (i == R.id.iv_back) {
            finish();

        } else if (i == R.id.btn_save) {
            finish();

        }
    }

    @Override
    public void onCheckedChanged(RadioGroup radioGroup, int i) {
        if (i == R.id.rb_unit) {
            llEin.setVisibility(View.VISIBLE);

        } else if (i == R.id.rb_personal) {
            llEin.setVisibility(View.GONE);

        }
    }
}
